/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package us.oh.k12.wkw.robot.command;

/**
 *
 * @author Team4145
 */
public class LauncherAngleToFeedCmd extends CommandBase {
    
    public LauncherAngleToFeedCmd() {
        
        super("LauncherAngleToFeedCmd");
        requires(this.getLaunchFrisbeeSystem());
        
    }
    
    protected void initialize() {
        
    
    }
    
    protected void execute() {
        
        if(this.getLaunchFrisbeeSystem().angleAboveFeedPoint()) {
            
            this.getLaunchFrisbeeSystem().turnOnDownAngle();
            
        }
        
        else if(!this.getLaunchFrisbeeSystem().angleAboveFeedPoint()) {
            
            this.getLaunchFrisbeeSystem().turnOnUpAngle();
            
        }
       
        
    }
    protected void end() {
        this.getLaunchFrisbeeSystem().stopChangingAngle();
    }
    
    protected boolean isFinished() {
        
        return(this.getLaunchFrisbeeSystem().getCurrentAngle()>29 && this.getLaunchFrisbeeSystem().getCurrentAngle()<33);
        
    }
}
